import React, { Component } from 'react';
// 3. 替换掉BrowserRouter，使用Router + history的方式自行绑定Router和history
import { Router, Route, Switch } from 'react-router-dom';
// 导入页面组件
import Login from './pages/Login';
import Layout from './pages/Layout';
import Test from 'pages/Test';
import { AuthRoute } from './components/AuthRoute';
import history from './utils/history';

export default class App extends Component {
  render() {
    return (
      <Router history={history}>
        <div>
          <Switch>
            <Route path={'/login'} component={Login}></Route>
            <Route path="/test" component={Test}></Route>
            <AuthRoute path="/" component={Layout}></AuthRoute>
          </Switch>
        </div>
      </Router>
    );
  }
}
